<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>麦知网——学问有余，可为人师</title>

<!-- Bootstrap core CSS -->
<link href="../css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../css/non-responsive.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/bootstrap-switch.css" rel="stylesheet">
<link href="../ico/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
<link href="../css/groups.css" rel="stylesheet">    

</head>
<body>
	{% include 'public/common/header.html' %}
	<div class="container" style="margin-top:45px">
		<div class="row">
			<div class="col-xs-12">
<!-- 两个按钮 -->
				<div class="twoBtn">
					<a href="{% url 'groups:groupcreate' %}"><b><i class="icon-wrench"></i> 创建小组</b></a>
					<a href="{% url 'users:managegroup' %}" style="margin-left:20px"><b><i class="icon-sitemap"></i> 我的小组</b></a>
				</div>
<!-- 所有小组 -->
				<div class="groups">
<!-- 一个小组 循环开始处 -->
					{% for i in groups %}					
					<div class="a_group pull-left">
						<div class="imgDiv"><img src="{{i.4}}/{{i.0}}" width="120px" class="img"></div>
						<div class="groupName"><a href="{% url 'groups:thegroup' i.3 %}"><strong>{{i.1}}</strong></a></div>
						<div class="switchDiv" id="joinDiv_{{i.3}}">
							<div class="switch switch-small" data-on="info" data-off="NO" >
<!--如果是  未加入的小组 -->	{% ifequal i.2 '0' %}
								<input type="checkbox" checked="checked" class="join_1" id="join{{i.3}}" onchange="join({{i.3}})"/> 
<!--如果是  已加入的小组 -->	{% else %}
								<input type="checkbox" id="join{{i.3}}" class="join_2" onchange="join({{i.3}})" />
							{% endifequal %}
							</div>
						</div>
					</div>	
					{% endfor %}
<!-- 一个小组 循环结束处 -->	
					<div class="clearfix"></div>
				</div>
				<div>
					<ul class="pager">
					{% if groups.has_previous %}
					  <li><a href="?page={{ groups.previous_page_number }}">&larr;上一页</a></li>
					{% endif %}
					第 {{ groups.number }} 页   共{{ groups.paginator.num_pages }} 页.
					{% if groups.has_next %}
					  <li><a href="?page={{ groups.next_page_number }}">下一页&rarr;</a></li>
					{% endif %}
					</ul>
				</div>
			</div>
		</div>
	</div>
	
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/logout.js"></script>
	<script src="../js/bootstrap.js"></script>
	<script src="../js/join.js"></script>
	<script src="../js/bootstrap-switch.js"></script>
	
</body>
</html>


